$(function(){
	$.ajax({
		url: "/album/allPictures",
		type: "post",
		dataType: "json",
		data:{},
		global:false,
		success: function(data){
			if(data.code==1){
				var imglist= data.obj;
				for (var i = 0; i < imglist.length; i++) {
                $("#imgUl").append("<li><div class='imagesShow'><a><img onclick='downLoad(this)' src='"+imglist[i].view+"'></a></div><span>上传作者："+imglist[i].userName+"</span></li>");
				}
			}else if(data.code==2){
				alert(data.message);
			}
		},
		error: function(msg){
			alert("ajax连接异常："+msg);
		}
	});

})
function downLoad(value){
	var path = value.getAttribute('src');
	var id=path.substring(20);
	var path="/album/imageDownLoad?id=";
    window.location.href=path+id;
}
